#! /usr/bin/python
# -*- coding: utf-8 -*-
import sys 
reload(sys) 
sys.setdefaultencoding('utf8') 

from HTMLParser import HTMLParser
class MLStripper(HTMLParser):
    def __init__(self):
        self.reset()
        self.fed = []

    def handle_data(self, d):
        self.fed.append(d)

    def get_data(self):
        return ''.join(self.fed)

def strip_tags(html):
    s = MLStripper()
    s.feed(html)
    return s.get_data()

f = open('/home/assassinpig/example.html', 'r')
html = f.read()
html = html.encode('utf-8')
raw = strip_tags(html)
print raw
f.close()
